var sessionid =  sessionStorage.getItem("sessionid");
$(function(){
	var sessionid = window.location.href.split("?")[1].split("&")[1].split("=")[1];
	console.log("op："+sessionid)
	var issueId = window.location.href.split("?")[1].split("=")[1].split("&")[0];
	console.log(issueId)
	$.ajax({
		type:"POST",
		url:"https://www.bjdeshangyuan.com/book/api/issue/detail",
		data:{
			sessionid:sessionid,
			id:issueId
		},
		success:function(data){
			var html="<div class='headlines'>"+
		      "<div class='headlines_title'>"+data.data.issueTitle+"</div>"+
		    "</div>"+
		    "<div class='initiator'>"+
		      "<div class='initiator_portrait'>"+
		        "<img src='"+data.data.headImgUrl+"'></img>"+
		      "</div>"+
		      "<div class='initiator_name'>发起人:&ensp;&ensp;"+data.data.nickName+"</div>"+
		      "<div class='initiator_name'>发起时间:&ensp;&ensp;"+data.data.issueCreatetime+"</div>"+
		    "</div>" +
		    "<div class='i_summary'>&ensp;&ensp;&ensp;"+data.data.issueContent+"</div>"+
		    "</div>"
			console.log(data)

			$("#problem").empty().append(html);
			

			/* 循环列表 */

			$('#count').text(data.data.issueCount); // 单取值
			var conlist= data.data.list;
			var str = '';
			for (var i = 0; i < conlist.length; i++) {
				//console.log(conlist[i].commentNiName);
				str+=  "<div class='messageBoard'>"+
						     "<div class='messageBoard_s'>"+
						        "<div class='messageBoard_s_img'>"+
						          "<img src='"+conlist[i].commentHeadImage+"'></img>"+
						        "</div>"+
						        "<div class='messageBoard_s_txt'>"+
						            "<div class='messageBoard_s_txt_head'>"+
						                "<div class='messageBoard_s_txt_head_name'>"+conlist[i].commentNiName+"</div>"+
						            "</div>"+
						            "<div class='messageBoard_s_txt_btm'> &ensp;&ensp;&ensp;"+conlist[i].commentText+"</div>"+
						               	
						           "<div class='messageBoard_s_txt_time'>发起时间:&ensp;&ensp;"+conlist[i].commentTime+"</div>"+
						        "</div>"+     
						    "</div>"+
						  "</div>"
			}

			 $("#review_content").html(str)

		}
	});
	/* 返回上一级页面 */
	$("#back").click(function(){
		window.history.back();
	})



	/* 跳转页面 */
	$(".me_comment_btn").click(function() {
		
		window.location.href="member_comments.html?issueId="+issueId+"&sessionid="+sessionid;
	})

})
